
function getContent(content) {
  let dataObj = {}
  let text = ''
  let oldIndex = 0
  content.replace(new RegExp('\t[\u4E00-\u9FFF]+', 'g'), (item,index) => {
    const length = index + item.length
    const label = content.substring(oldIndex, index).replace(/^\s+|\s+$/g, '')
    const value = item.replace(/^\s+|\s+$/g, '')
    if (dataObj[`${value}`]) {
      dataObj[`${value}`].push(label)
    } else {
      dataObj[`${value}`] = [label]
    }
    oldIndex = length
  })
  for (const Key in dataObj) {
    let keyText = ''
    dataObj[`${Key}`].forEach((item, index) => {
      keyText += `
        ${index + 1}、${item}`
    })
    text += `
      ${Key}${keyText}
      `
  }
  return text
}
const a1Value = await Input.textAsync('将文档内容复制到这里')
console.log(getContent(`${a1Value}`))
